package com.cloudpolice.door.feignInterface;

import com.cloudpolice.door.feignInterface.hystric.EquipmentAdvertisingInterFaceHystric;
import lh.model.ResultVO;
import lh.model.ResultVOPage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;

/**
 * @author ：梁昊，后端工程师：flyman5，前端工程师：孙耀
 * @create 2020-04-02 12:44
 * @function
 * @editLog
 */
@Repository
@FeignClient(value = "equipment-mucon/equipmentAdvertisingController", fallback = EquipmentAdvertisingInterFaceHystric.class)
public interface EquipmentAdvertisingInterFace {
    @PostMapping("/insertEquipmentAdvertising")
    ResultVO insertEquipmentAdvertising(@RequestParam(value = "id") String id
            , @RequestParam(value = "communityId") String communityId
            , @RequestParam(value = "periodId") String periodId
            , @RequestParam(value = "sortNo") int sortNo
            , @RequestParam(value = "beginDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginDate
            , @RequestParam(value = "endDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate);

    @PostMapping("/updateEquipmentAdvertisingById")
    ResultVO updateEquipmentAdvertisingById(@RequestParam(value = "id") String id
            , @RequestParam(value = "communityId") String communityId
            , @RequestParam(value = "periodId") String periodId
            , @RequestParam(value = "sortNo") int sortNo
            , @RequestParam(value = "beginDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginDate
            , @RequestParam(value = "endDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate);

    @PostMapping("/selectEquipmentAdvertising")
    ResultVOPage selectEquipmentAdvertising(@RequestParam(value = "communityId") String communityId
            , @RequestParam(value = "periodId") String periodId);

    @PostMapping("/deleteEquipmentAdvertisingById")
    int deleteEquipmentAdvertisingById(@RequestParam(value = "id", required = false) String id
            , @RequestParam(value = "communityId", required = false) String communityId
            , @RequestParam(value = "periodId", required = false) String periodId);

    @PostMapping("/deleteEquipmentAdvertisingAuto")
    int deleteEquipmentAdvertisingAuto();
}
